﻿$(document).ready(function () {
    $("#subMenu #deleteBtn").click(function () {

        if ($("table.tablelist tbody tr.tableselectedrow").length == 0)
        {
            alert("请先选中一行！");
            return;
        }

        $("table.tablelist tbody tr").each(function () {
            
            if($(this).hasClass("tableselectedrow"))
            {
                var bln = window.confirm("确定删除该行吗?");
                if (bln)
                {
                    //$(this).remove();
                    var id = $(this).attr("id");
                    //alert(id);
                    $.ajax({
                        type: "POST",
                        url: "/Dictionary/Delete",
                        data: "id=" + id,
                    });
                    $(this).remove(); 
                }
                $("table.tablelist tbody tr").each(function (index) {
                    $(this).children().eq(0).html(index + 1);
                });
            }
        
        });

        
    });
        
});